﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Runtime.Serialization;

namespace RemotingMessage
{
    [DataContract]
    public class ClientInfo 
    {
        [MessageHeader]
        public string Header = "Header1";
        [PeerHopCount]
        private int _hopCount;
        public ClientInfo(string userName, string machineName, string softwareVersion, string strIpAddres)
        {
            UserName = userName;
            MachineName = machineName;
            SoftwareVersion = softwareVersion;
            IpAddres = strIpAddres;
            _hopCount = 1;
        }

        #region Properties
        #region UserName
        [DataMember]
        private string userName;
        public string UserName
        {
            get { return userName; }
            private set
            {
                if (userName == value) return;
                userName = value;
            }
        }
        #endregion

        #region IpAddres
        [DataMember]
        private string strIpAddres;
        public string IpAddres
        {
            get { return strIpAddres; }
            private set
            {
                if (strIpAddres == value) return;
                strIpAddres = value;
            }
        }
        #endregion

        #region MachineName
        [DataMember]
        private string machineName;
        public string MachineName
        {
            get { return machineName; }
            private set
            {
                if (machineName == value) return;
                machineName = value;
            }
        }
        #endregion

        #region SoftwareVersion
        [DataMember]
        private string softwareVersion;
        public string SoftwareVersion
        {
            get { return softwareVersion; }
            private set
            {
                if (softwareVersion == value) return;
                softwareVersion = value;
            }
        }
        #endregion

        #region IsOnline
        [DataMember]
        private bool bIsOnline;
        public bool IsOnline
        {
            get { return bIsOnline; }
            set
            {
                if (bIsOnline == value) return;
                bIsOnline = value;
            }
        }
        #endregion

        #region IsSendMedia
        [DataMember]
        private bool bIsSendMedia;
        public bool IsSendMedia
        {
            get { return bIsSendMedia; }
            set
            {
                if (bIsSendMedia == value) return;
                bIsSendMedia = value;
            }
        }
        #endregion

        #region ClientType
        [DataMember]
        private ClientTypes clientType;
        public ClientTypes ClientType
        {
            get { return clientType; }
            set
            {
                if (clientType == value) return;
                clientType = value;
            }
        }
        #endregion

        #endregion
    }

    [DataContract]
    public class SendBytes
    {
        [DataMember]
        public string From;
        [DataMember]
        public List<string> To;
        [DataMember]
        public byte[] Data;
        [DataMember]
        public DateTime TimeStamp;
        [DataMember]
        public int IndexMessage ;
    }


    /// <summary>
    /// Тип клиента
    /// </summary>
    public enum ClientTypes 
    {
        /// <summary>
        /// Обычные клиенты
        /// </summary>
        Normal,
        /// <summary>
        /// Клиенты с функцией видеоконференции
        /// </summary>
        Extended,
        /// <summary>
        /// Серверная сторона
        /// </summary>
        Server
    }

 
}
